﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System;
using System.Windows;
using WebCam;

namespace WpfImageDuplicates
{
    public class WebCam3WindowHandler : WindowHandlerBase<WebCam3Window, Window>
    {        
        public WebCam3WindowHandler(Window1 parentWindow) : base(parentWindow)
        {
            _parentWindow = parentWindow;
        }

        public override void OpenWindow(Window owner)
        {
            if (_window == null)
            {
                _window = new WebCam3Window() { Owner = owner };
                _window.Closed += new EventHandler(_window_Closed);
            }
            
            _window.Show();
            _window.Focus();
            _window.SetPostProcessors(Window1.MainWindow.FilterHandler.CurrentFilterCollection.Collection);
        }
        
        private void _window_Closed(object sender, EventArgs e)
        {
            _window.Closed -= _window_Closed;
            _window = null;
        }
    }
}
